package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.vo.Student;
import com.ruoyi.system.mapper.StudentMapper;
import com.ruoyi.system.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements IStudentService {

    @Autowired
    private StudentMapper studentMapper;
    //新增学生
    @Override
    public String add(Student student) {
        int i = studentMapper.insertStudent(student);
        if (i==0){
            return "添加失败";
        }else {
            return "添加成功";
        }
    }
    //查询学生
    @Override
    public List<Student> select(Student student) {

        return studentMapper.selectStudent(student);
    }
}
